//
//  AddressOneCell.m
//  CenturyCity
//
//  Created by beisheng03 on 2017/12/27.
//  Copyright © 2017年 beisheng. All rights reserved.
//

#import "AddressOneCell.h"

@interface AddressOneCell ()
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *phoneLabel;
@property (weak, nonatomic) IBOutlet UILabel *addressLabel;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottomMargin;
@property (weak, nonatomic) IBOutlet UILabel *detailLabel;

@end

@implementation AddressOneCell

- (void)awakeFromNib {
    
    [super awakeFromNib];
    
    self.backgroundColor = [UIColor whiteColor];
    
    self.bottomMargin.constant = 6;
    
    self.nameLabel.font = MYFONT(16);
    
    self.phoneLabel.font = MYFONT(16);
    
    self.addressLabel.font = MYFONT(14);
    
    self.addressLabel.textColor = darkGray;
    
    self.detailLabel.font = MYFONT(14);
    
    self.detailLabel.textColor = darkGray;
}


- (void)setModel:(AddressInfoModel *)model{
    _model = model;
    
    self.nameLabel.text = _model.consigner;
    
//    NSMutableString *temp = _model.address_info.mutableCopy;
//    NSString *str = [temp stringByReplacingOccurrencesOfString:@"-" withString:@""];
    
    if ([_model.address_info hasSuffix:@"-"]) {
        
       self.addressLabel.text =  [_model.address_info substringToIndex:_model.address_info.length - 1];

    } else {
        
       self.addressLabel.text =  _model.address_info;
        
    }
    
    self.detailLabel.text = _model.address;
    
    self.phoneLabel.text = _model.mobile;
    
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    
    [super setSelected:selected animated:animated];
    
    
    

}

@end
